<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
    工程名：HebeuCS
    时间： 16-11-10
    作者：白雨濃 evil
    邮箱：evilbai@foxmail.com
    内容：发布新贴子
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--去除多余空格--%>
<%@ page trimDirectiveWhitespaces="true" %>
<%--h5声明--%>
<!DOCTYPE html>
<html>
<head>
    <title>我要发贴</title>

    <%@include file="../common/basehead.jsp" %>

    <link href="${pageContext.request.contextPath}/static/css/release_newpost.css" rel="stylesheet"/>
    <link href="https://pandao.github.io/editor.md/examples/css/style.css" rel="stylesheet">
    <link href="https://pandao.github.io/editor.md/css/editormd.css" rel="stylesheet">
    <link href="http://cdn.bootcss.com/toastr.js/latest/css/toastr.min.css" rel="stylesheet">

    <link href="http://cdn.bootcss.com/select2/4.0.3/css/select2.min.css" rel="stylesheet">
</head>
<body>
<div class="main div">

    <div id="left-float">
        <button class="btn-boot btn-info">
            <span class="glyphicon glyphicon-eye-open"></span>
        </button>
    </div>

    <div id="left-menu" class="left-menu">
        <a id="left-menu-btn" href="#" class="list-group-item"
           style=" border-radius: 0;border: 0;background-color: #5bc0de">
            <span class="glyphicon glyphicon-th-list"></span>
        </a>
        <br>
        <br>
        <div style="text-align: center">
            <img id="left-menu-headimg" class="img-circle" style="margin: auto"
                 src="${pageContext.request.contextPath}/static/image/headimg/${user.userImgPath}"
                 alt="头像" width="30px" height="30px">
            <div id="left-menu-userinfo" style="margin-top: 20px">

            </div>
        </div>
        <br>
        <a id="left-menu-insert" href="#" class="list-group-item" title="代码插入工具"
           data-toggle="modal" data-target="#insert-code"
           style=" border-radius: 0;border: 0;background-color: #2A2A2A;text-align: center">
            <span class="glyphicon glyphicon-indent-left"></span>
        </a>

        <a id="left-menu-close" href="#" class="list-group-item" title="隐藏侧边栏"
           style=" border-radius: 0;border: 0;background-color: #2A2A2A;text-align: center;margin-top: 30px">
            <span class="glyphicon glyphicon-eye-close">   隐藏侧边栏</span>
        </a>
    </div>
    <div class="content">
        <div style="margin: auto;width: 800px;">
            <div style="height: 5px"></div>
            <input id="title" type="text" class="form-control" name="title"
                   placeholder="请写入文章标题"
                   style="width: 600px;margin: auto">
            <div style="margin: 10px;text-align: center">
                <select id="code-type" class="select" title="代码类型">
                    <c:forEach var="codeType" items="${codeTypeList}" begin="1">
                        <option>${codeType.codeTypeEntity.codeType}</option>
                    </c:forEach>
                </select>
                <select id="post-type" class="select" title="文章类型">
                    <option>博客</option>
                    <option>提问</option>
                </select>
                <button id="submit" class="btn-boot btn-info">发布文章</button>
            </div>
            <div>
                <p style="color:grey">提示:请使用MarkDown语法进行编辑，如需插入代码，编辑器顶部有"<span style="color: #EF443D">代码块</span>"功能。另外，由于网站带宽不足，<span
                        style="color: #EF443D">不提供图片上传功能</span>，请使用图片外链！
                </p>
            </div>
        </div>

        <div id="editormd"></div>
    </div>
</div>

</body>
<script src="${pageContext.request.contextPath}/static/js/release_newpost.js"></script>
<script src="http://cdn.bootcss.com/toastr.js/latest/js/toastr.min.js"></script>
<script src="https://pandao.github.io/editor.md/editormd.js"></script>
<script src="http://cdn.bootcss.com/select2/4.0.3/js/select2.min.js"></script>
<script>

    $(function ()
    {
        $('.select').select2({
            placeholder: '请选择'
        });

        var username = '${user.userName}';
        var userrealname = '${user.userRealName}';

        release_newpost.editormd(${post});
        release_newpost.left_btn(username, userrealname);
        release_newpost.submit();
    });

</script>
</html>
